﻿#include <QRectF>
#include <QColor>
#include <QBrush>
#include "dicebag.h"
#include "dieitem.h"

DiceBag::DiceBag(qreal x, qreal y, QGraphicsItem* containerItem, QGraphicsItem* parent)
    : QGraphicsRectItem(x, y, 200.0, 300.0, parent), m_containerItem(containerItem)
{
    setBrush(QBrush(QColor(183, 207, 255, 50)));
    setZValue(1);

    DieItem* die;
    die = new DieItem(DieItem::Four, QRectF(x + 10, y + 10, 80, 80), this);
    die->setContainerItem(m_containerItem);
    die->create();
    die = new DieItem(DieItem::Six, QRectF(x + 110, y + 10, 80, 80), this);
    die->setContainerItem(m_containerItem);
    die->create();
    die = new DieItem(DieItem::Eight, QRectF(x + 10, y + 110, 80, 80), this);
    die->setContainerItem(m_containerItem);
    die->create();
    die = new DieItem(DieItem::Ten, QRectF(x + 110, y + 110, 80, 80), this);
    die->setContainerItem(m_containerItem);
    die->create();
    die = new DieItem(DieItem::Twelve, QRectF(x + 10, y + 210, 80, 80), this);
    die->setContainerItem(m_containerItem);
    die->create();
    die = new DieItem(DieItem::Twenty, QRectF(x + 110, y + 210, 80, 80), this);
    die->setContainerItem(m_containerItem);
    die->create();
}

